#include "dialogwait.h"
#include "ui_dialogwait.h"

#include <QMovie>

DialogWait::DialogWait(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::DialogWait)
{
    ui->setupUi(this);




    this->setFixedSize(500,200);
    //设置透明用
    //setWindowOpacity(0.5);
    //取消对话框标题
    //this->setWindowFlags(Qt::Dialog|Qt::CustomizeWindowHint);

    //设置Margins
    //this->setContentsMargins(0,0,0,0);
    //label->setContentsMargins(0,0,0,0);
    //this->setAutoFillBackground(true);

    //取消对话框标题和边框
    this->setWindowFlags(Qt::Dialog|Qt::FramelessWindowHint);

    //connect(ui->pushButton_exit,SIGNAL(clicked()),this,SLOT(dlgEsc())); //取消事件

     connect(this,SIGNAL(end_waitting()),this,SLOT(dlgEsc())); //取消事件


    movie = new QMovie(":/new/prefix1/images/WaitProgressGif.gif");  //添加动态的gif滚动条图片
    ui->label_wait_gif->setMovie(movie);
    movie->start();
}

DialogWait::~DialogWait()
{
    delete ui;
}

void DialogWait::on_pushButton_exit_clicked()
{

    emit end_waitting();
}


void DialogWait::dlgEsc()
{
    m_isRet = true;
    movie->stop();

    close();
}
